import React from 'react'
import { Redirect, Router, IndexRoute, Route, hashHistory, browserHistory } from 'react-router'
import { Provider } from 'react-redux'
import { render } from 'react-dom'
import configure from './store'
import App from './App'
import Login from './Login'
import Signup from './Signup'
import FindPassword from './FindPassword'
import SetPassword from './SetPassword'
import NewAccount from './NewAccount'
import Activate from './Activate'
import Invalid from '../containers/invalid'

const store = configure()

render(
	<Provider store={store}>
		<Router history={hashHistory}>
			<Route path="/" component={App}>
				<IndexRoute component={Login}/>
				<Route path="login" component={Login}/>
				<Route path="signup" component={Signup}/>
				<Route path="findpassword" component={FindPassword}/>
				<Route path="find-password" component={SetPassword}/>
				<Route path="new-account" component={NewAccount}/>
				<Route path="init-password" component={SetPassword}/>
				<Route path="activate" component={Activate}/>
        <Route path="invalid" component={Invalid}/>
        <Redirect from="*" to="login"/>
			</Route>
		</Router>
	</Provider>,
	document.getElementById('root')
)
